package com.zf.bm.common.core.sys.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zf.bm.common.core.base.service.BaseService;
import com.zf.bm.common.core.sys.dao.CitycodeDao;
import com.zf.bm.common.core.sys.entity.Citycode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author guojing
 * @since 2021-08-05
 */
@DS("master")
@Service
@Transactional(readOnly = true)
public class CitycodeService extends BaseService<CitycodeDao, Citycode> {
    @Autowired
    private CitycodeDao citycodeDao;

    public List<Citycode> getCityCode() {
        return citycodeDao.selectList(new QueryWrapper<>());
    }

    public String getCityCode(String name){
        return citycodeDao.getCode(name);
    }
}
